from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings


class Account(AbstractUser):
    link = models.URLField('个人网站', blank=True, null=True, help_text='个人网站')
    avatar = models.ImageField('头像', upload_to='avatar/upload/%Y/%m/%d/%H-%M-%S',
                               default='avatar/default/default.png', help_text='头像')

    class Meta:
        verbose_name = '用户'
        verbose_name_plural = verbose_name
        ordering = ['-id']

    def __str__(self):
        return self.username

